package oop;

import java.io.BufferedReader;
import java.io.BufferedWriter;
import java.io.File;
import java.io.FileReader;
import java.io.FileWriter;
import java.io.IOException;
import java.util.Scanner;

public class Unit45 {
	public static void main(String[] args){
		
//		try {
//			File file = new File("text.txt");
//			file.createNewFile();
//			
//			FileWriter fw = new FileWriter(file);
//			BufferedWriter bw = new BufferedWriter(fw);
//			System.out.println("Insert string want write to file");
//			Scanner scanner = new Scanner(System.in);
//			String s = scanner.nextLine();
//			bw.write(s);
//			bw.close();
//			fw.close();
//			
//		} catch (IOException e) {
//			// TODO Auto-generated catch block
//			e.printStackTrace();
//		}
		File file = new File("text.txt");
			try {
			FileReader fr = new FileReader(file);
			BufferedReader br = new BufferedReader(fr);
			String s = "";
			while ((s = br.readLine()) != null) {
				System.out.println(s);
			}
			br.close();
			fr.close();
		} catch (IOException e) {
			// TODO Auto-generated catch block
			e.printStackTrace();
		}
		
	}
}
